/**
ysbEePatchTest.mg
*/


class AppDelegate:UIResponder {

- (void)openProtectionsAction {
    self.openAvoidCrashAction();

}


- (void)closeWebSocket {
    YSBWebSocketManager.shared().webSocketClose();
    YSBChatRoomWebSocketManager.shared().webSocketClose();
}


- (void)openWebSocket {
    if (YSBUserDefaultsTool.boolForKey:(@"kIsLoginSuccess")) {
        YSBWebSocketManager.shared().webSocketClose();
        YSBWebSocketManager.shared().connectServer();
        
        YSBChatRoomWebSocketManager.shared().webSocketClose();
        YSBChatRoomWebSocketManager.shared().connectServer();
    }
    
}



}


class YSBHomeController:YSBViewController {

- (void)judgeShowOrHidePopViewWithModel:(YSBSystemConfigModel *)configModel {

    if (configModel.recommendedModel.startTime.length > 0 && configModel.recommendedModel.endTime.length > 0) {
    
        NSString *startTimeStr = configModel.recommendedModel.startTime;
        NSString *endTimeStr = configModel.recommendedModel.endTime;
        
        NSMutableString *mutStr = NSMutableString.alloc().initWithString:(@"每日优选于每日 \n");
        mutStr.appendString:(startTimeStr);
        mutStr.appendString:(@"~");
        mutStr.appendString:(endTimeStr);
        mutStr.appendString:(@"开启");
    
        self.popLabel.text = mutStr;
    }
    
   self.performSelector:withObject:afterDelay:(@selector(delayMethod),nil,2.2);
    
}

- (void)delayMethod {
    self.dealWithShowOrHidePop();
    YSBMSAlertManager.shareManager().showAlerts();
}


}

